﻿using System;
using Awesomium.Windows.Controls;
using FazaDemo.PL.AbstractPresenters;

namespace FazaDemo.PL.EventFactories
{
    public class WorkAreaEventFactory : EventFactory
    {
        public WorkAreaEventFactory(IPresenter presenter) : base(presenter)
        {
        }

        public override ConcreteEvent GetConcreteEvent(object e, Action<ConcreteEvent> action)
        {
            if (e is WebControl)
            {
                return new ConcreteWebEvent(action) {Control = (WebControl)e, Presenter = _presenter};
            }
            return null;
        }
    }
}